app=$1
img=$2

docker pull $img

echo "正在启动 $app ..."
 
host_ip=$(docker network inspect bridge | grep Gateway | awk '{print $NF}' | sed 's/"//g')

docker kill $app ; docker rm $app



docker run -d  --name $app --net vm \
  -e PROFILE=prod -e APP_NAME=$app \
  --add-host=nacos:172.20.0.1 \
  --add-host=mysql:172.20.0.1 \
  --add-host=mongo:172.20.0.1 \
  --add-host=thc:172.20.0.1 \
  --add-host=redis:172.20.0.1 \
  --add-host=rabbitmq:172.20.0.1 \
  --add-host=es:172.20.0.1 \
  --add-host=minio:172.20.0.1 \
  $img
